const routes = [
  {
    name: 'layout',
    path: '/',
    component: () => import('@/views/Layout.vue'),
    redirect: '/home',
    meta: {
      title: '',
      keepAlive: true,
    },
    children: [
      {
        name: 'home',
        path: '/home',
        component: () => import('@/views/Home.vue'),
        meta: {
          title: '首页',
          scrollState: true,
          keepAlive: true,
        },
      },
      {
        name: 'system',
        path: '/system',
        component: () => import('@/views/System.vue'),
        meta: {
          title: '体系',
          scrollState: true,
          keepAlive: true,
        },
      },
      {
        name: 'wechat',
        path: '/wechat',
        component: () => import('@/views/Wechat.vue'),
        meta: {
          title: '公众号',
          scrollState: true,
          keepAlive: true,
        },
      },
      {
        name: 'project',
        path: '/project',
        component: () => import('@/views/Project.vue'),
        meta: {
          title: '项目',
          scrollState: true,
          keepAlive: true,
        },
      },
      {
        name: 'site',
        path: '/site',
        component: () => import('@/views/SiteMap.vue'),
        meta: {
          title: '导航',
          scrollState: true,
          keepAlive: true,
        },
      },
    ]
  },
  {
    name: 'login',
    path: '/login',
    component: () => import('@/views/Login.vue'),
    meta: {
      title: '登录',
      keepAlive: false,
    },
  },
  {
    name: 'register',
    path: '/register',
    component: () => import('@/views/Register.vue'),
    meta: {
      title: '注册',
      keepAlive: false,
    },
  },
  {
    name: 'collect',
    path: '/collect',
    component: () => import('@/views/Collect.vue'),
    meta: {
      title: '收藏',
      auth: true,
      keepAlive: false,
    },
  },
  {
    name: '*',
    path: '/:w+',
    component: () => import('@/views/Unknown.vue'),
    meta: {
      title: '未知',
    },
  }
]

export default routes
